package com.tandashi.springbootstudy01.web.controller;

import com.tandashi.springbootstudy01.convention.constants.StringConst;
import com.tandashi.springbootstudy01.dto.RestBaseResponse;
import com.tandashi.springbootstudy01.dto.RestGeneralResponse;
import com.tandashi.springbootstudy01.dto.opening.Kmh2024TargetCustStats;
import com.tandashi.springbootstudy01.service.Opening2024CustomerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api("开门红2024-接口")
@RequestMapping("/opening/2024/customer")
@Slf4j
public class Opening2024CustomerController {

    @GetMapping("/findKmh2024TargetCustStas")
    @ApiOperation(value = "查询目标客户行为统计数据", response = Kmh2024TargetCustStats.class, notes = "1:目标客户，0：全部客户")
    public RestBaseResponse findKmh2024TargetCustStats(@RequestParam(required = false, defaultValue = "1") String tab) {
        return RestGeneralResponse.of(opening2024CustomerService.findKmh2024TargetCustStats("00001072392", tab, StringConst.YES));
    }

    @Autowired
    private Opening2024CustomerService opening2024CustomerService;
}
